import './App.css'
import { BrowserRouter as Router, Route, Routes, Navigate } from 'react-router-dom'

//页面组件
import Container from './pages/Container'

import Home from './pages/Home';
import { News } from './pages/News';
import Message from './pages/Message';
import User from './pages/User';
import Map from './pages/Map';

const App = () => (
  <Router>
    <div className='App'>
      <Routes>
        <Route path='/home' element={<Container path='/home' />}>
          <Route index element={<Home />}></Route>
          <Route path='news' element={<News />}></Route>
          <Route path='message' element={<Message />}></Route>
          <Route path='user' element={<User />}></Route>
        </Route>
        <Route path='/map' element={<Map></Map>}></Route>
        <Route path="*" element={<Navigate to="/home" />} />
      </Routes>

    </div>
  </Router >
)

export default App;
